<template>
  <view class="none font-middle flex flex-middle flex-center">
    <view>
      <u-empty icon="/static/image/common/none.png" text="哦豁，没有网络了～" />
      <view>请检查网络连接后点击重试按钮</view>
      <u-button
        class="button"
        size="small"
        color="#31BC4E"
        text="重试"
        @click="btnClick"
      />
    </view>
  </view>
</template>

<script>
import { mapGetters } from "vuex";
export default {
  computed: {
    ...mapGetters(["networkType"]),
  },
  methods: {
    btnClick() {
      if (this.networkType == "none")
        return this.$toast("请检查网络连接后重试");

      // #ifdef APP-PLUS
      plus.runtime.restart();
      // #endif

      // #ifdef H5
      this.$reLaunch("/pages/home/index");
      // #endif
    },
  },
};
</script>

<style scoped lang="scss">
.none {
  height: 100vh;
  color: #c0c4cc;
  .button {
    margin-top: 12px;
  }
}
</style>